using System;
using System.Collections.Generic;

namespace B.S.XZYData.Domain.LJC.Dto
{
    /// <summary>
    /// 工单报工关联视图DTO - 用于查询时组合显示工单和报工信息
    /// </summary>
    public class WorkOrderReportViewDto
    {
        /// <summary>
        /// 记录ID（关联关系的唯一标识）
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 关联表ID
        /// </summary>
        public int RelationId { get; set; }

        /// <summary>
        /// 工单ID
        /// </summary>
        public int WorkOrderId { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        public string? WorkOrderCode { get; set; }

        /// <summary>
        /// 报工ID
        /// </summary>
        public int WorkReportId { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        public string? ProductCode { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string? ProductName { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string? Spec { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 工单状态
        /// </summary>
        public string? Status { get; set; }

        /// <summary>
        /// 计划开始时间
        /// </summary>
        public DateTime? PlannedStartTime { get; set; }

        /// <summary>
        /// 计划结束时间
        /// </summary>
        public DateTime? PlannedEndTime { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        public int? PlannedQuantity { get; set; }

        /// <summary>
        /// 实际数量
        /// </summary>
        public int? ActualQuantity { get; set; }

        /// <summary>
        /// 良品数量
        /// </summary>
        public int? GoodQuantity { get; set; }

        /// <summary>
        /// 不良品数量
        /// </summary>
        public int? BadQuantity { get; set; }

        /// <summary>
        /// 报工时长（小时）
        /// </summary>
        public decimal ReportHours { get; set; }

        /// <summary>
        /// 生产进度
        /// </summary>
        public string? Progress { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreateBy { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string? UpdateBy { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 工序列表（一对多）
        /// </summary>
        public List<WorkOrderProcessBriefDto> Processes { get; set; } = new List<WorkOrderProcessBriefDto>();
    }

    /// <summary>
    /// 工序精简信息（用于工单报工列表展示）
    /// </summary>
    public class WorkOrderProcessBriefDto
    {
        /// <summary>
        /// 工序ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 所属工单ID
        /// </summary>
        public int WorkOrderId { get; set; }

        /// <summary>
        /// 顺序号
        /// </summary>
        public int Sequence { get; set; }

        /// <summary>
        /// 工序编号
        /// </summary>
        public string ProcessCode { get; set; }

        /// <summary>
        /// 工序名称
        /// </summary>
        public string ProcessName { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        public int? PlannedQuantity { get; set; }

        /// <summary>
        /// 已报工数
        /// </summary>
        public int? ReportedQuantity { get; set; }

        /// <summary>
        /// 良品数
        /// </summary>
        public int? GoodQuantity { get; set; }

        /// <summary>
        /// 不良品数
        /// </summary>
        public int? BadQuantity { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public string? Status { get; set; }
    }
}